package dao.pojo;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.TableGenerator;

/**
 * IfwAgentDevInfo entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "ifw_agent_dev_info", catalog = "fw")
public class IfwAgentDevInfo extends BasePojo implements java.io.Serializable {

	// Fields

	private Integer agentDevIndex;
	private IfwAgentRegInfo ifwAgentRegInfo;
	private String agentName;
	private String name;
	private String sn;
	private String addr;
	private String user;
	private String phone1;
	private String phone2;
	private String email;
	private String addTime;
	private String editTime;
	private Boolean enabled;
	
	private Set<IfwRechargeInfo> ifwRechargeInfos = new HashSet<IfwRechargeInfo>(
			0);
	private Set<IfwAgentConsumeRecord> ifwAgentConsumeRecords = new HashSet<IfwAgentConsumeRecord>(
			0);

	@Override
	public Object getEntityId() {
		// TODO Auto-generated method stub
		return agentDevIndex;
	}

	// Property accessors
	@Id
	@TableGenerator(name = "AGENTDEVINDEX_GEN", table = "sequence", pkColumnName = "SEQ_NAME", valueColumnName = "SEQ_COUNT", pkColumnValue = "SEQ_AGENTDEVINDEX", allocationSize = 1)
	@GeneratedValue(strategy = GenerationType.TABLE, generator = "AGENTDEVINDEX_GEN")
	@Column(name = "agent_dev_index", unique = true, nullable = false)
	public Integer getAgentDevIndex() {
		return this.agentDevIndex;
	}

	public void setAgentDevIndex(Integer agentDevIndex) {
		this.agentDevIndex = agentDevIndex;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "agent_index")
	public IfwAgentRegInfo getIfwAgentRegInfo() {
		return this.ifwAgentRegInfo;
	}

	public void setIfwAgentRegInfo(IfwAgentRegInfo ifwAgentRegInfo) {
		this.ifwAgentRegInfo = ifwAgentRegInfo;
	}

	@Column(name = "agent_name", nullable = false, length = 32)
	public String getAgentName() {
		return this.agentName;
	}

	public void setAgentName(String agentName) {
		this.agentName = agentName;
	}

	@Column(name = "name", nullable = false)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "sn", nullable = false, length = 32)
	public String getSn() {
		return this.sn;
	}

	public void setSn(String sn) {
		this.sn = sn;
	}

	@Column(name = "addr")
	public String getAddr() {
		return this.addr;
	}

	public void setAddr(String addr) {
		this.addr = addr;
	}

	@Column(name = "user", length = 32)
	public String getUser() {
		return this.user;
	}

	public void setUser(String user) {
		this.user = user;
	}

	@Column(name = "phone1", length = 32)
	public String getPhone1() {
		return this.phone1;
	}

	public void setPhone1(String phone1) {
		this.phone1 = phone1;
	}

	@Column(name = "phone2", length = 32)
	public String getPhone2() {
		return this.phone2;
	}

	public void setPhone2(String phone2) {
		this.phone2 = phone2;
	}

	@Column(name = "email", length = 64)
	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@Column(name = "add_time", length = 14)
	public String getAddTime() {
		return this.addTime;
	}

	public void setAddTime(String addTime) {
		this.addTime = addTime;
	}

	@Column(name = "edit_time", length = 14)
	public String getEditTime() {
		return this.editTime;
	}

	public void setEditTime(String editTime) {
		this.editTime = editTime;
	}
	
	@Column(name = "enabled")
	public Boolean getEnabled() {
		return enabled;
	}
	
	public void setEnabled(Boolean enabled) {
		this.enabled = enabled;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "ifwAgentDevInfo")
	public Set<IfwRechargeInfo> getIfwRechargeInfos() {
		return this.ifwRechargeInfos;
	}

	public void setIfwRechargeInfos(Set<IfwRechargeInfo> ifwRechargeInfos) {
		this.ifwRechargeInfos = ifwRechargeInfos;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "ifwAgentDevInfo")
	public Set<IfwAgentConsumeRecord> getIfwAgentConsumeRecords() {
		return this.ifwAgentConsumeRecords;
	}

	public void setIfwAgentConsumeRecords(
			Set<IfwAgentConsumeRecord> ifwAgentConsumeRecords) {
		this.ifwAgentConsumeRecords = ifwAgentConsumeRecords;
	}

}